{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":11204883,"sourceType":"datasetVersion","datasetId":6996180}],"dockerImageVersionId":30919,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"!pip install wfdb","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:12:48.665911Z","iopub.execute_input":"2025-04-01T17:12:48.666239Z","iopub.status.idle":"2025-04-01T17:12:53.107670Z","shell.execute_reply.started":"2025-04-01T17:12:48.666212Z","shell.execute_reply":"2025-04-01T17:12:53.106577Z"}},"outputs":[{"name":"stdout","text":"Collecting wfdb\n  Downloading wfdb-4.2.0-py3-none-any.whl.metadata (3.7 kB)\nRequirement already satisfied: matplotlib>=3.2.2 in /usr/local/lib/python3.10/dist-packages (from wfdb) (3.7.5)\nRequirement already satisfied: numpy>=1.26.4 in /usr/local/lib/python3.10/dist-packages (from wfdb) (1.26.4)\nRequirement already satisfied: pandas>=2.2.3 in /usr/local/lib/python3.10/dist-packages (from wfdb) (2.2.3)\nRequirement already satisfied: requests>=2.8.1 in /usr/local/lib/python3.10/dist-packages (from wfdb) (2.32.3)\nRequirement already satisfied: scipy>=1.13.0 in /usr/local/lib/python3.10/dist-packages (from wfdb) (1.13.1)\nRequirement already satisfied: soundfile>=0.10.0 in /usr/local/lib/python3.10/dist-packages (from wfdb) (0.12.1)\nRequirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->wfdb) (1.3.1)\nRequirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->wfdb) (0.12.1)\nRequirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->wfdb) (4.55.3)\nRequirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->wfdb) (1.4.7)\nRequirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->wfdb) (24.2)\nRequirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->wfdb) (11.0.0)\nRequirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->wfdb) (3.2.0)\nRequirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib>=3.2.2->wfdb) (2.9.0.post0)\nRequirement already satisfied: mkl_fft in /usr/local/lib/python3.10/dist-packages (from numpy>=1.26.4->wfdb) (1.3.8)\nRequirement already satisfied: mkl_random in /usr/local/lib/python3.10/dist-packages (from numpy>=1.26.4->wfdb) (1.2.4)\nRequirement already satisfied: mkl_umath in /usr/local/lib/python3.10/dist-packages (from numpy>=1.26.4->wfdb) (0.1.1)\nRequirement already satisfied: mkl in /usr/local/lib/python3.10/dist-packages (from numpy>=1.26.4->wfdb) (2025.0.1)\nRequirement already satisfied: tbb4py in /usr/local/lib/python3.10/dist-packages (from numpy>=1.26.4->wfdb) (2022.0.0)\nRequirement already satisfied: mkl-service in /usr/local/lib/python3.10/dist-packages (from numpy>=1.26.4->wfdb) (2.4.1)\nRequirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas>=2.2.3->wfdb) (2025.1)\nRequirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.10/dist-packages (from pandas>=2.2.3->wfdb) (2025.1)\nRequirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.8.1->wfdb) (3.4.1)\nRequirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.8.1->wfdb) (3.10)\nRequirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.8.1->wfdb) (2.3.0)\nRequirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.8.1->wfdb) (2025.1.31)\nRequirement already satisfied: cffi>=1.0 in /usr/local/lib/python3.10/dist-packages (from soundfile>=0.10.0->wfdb) (1.17.1)\nRequirement already satisfied: pycparser in /usr/local/lib/python3.10/dist-packages (from cffi>=1.0->soundfile>=0.10.0->wfdb) (2.22)\nRequirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib>=3.2.2->wfdb) (1.17.0)\nRequirement already satisfied: intel-openmp>=2024 in /usr/local/lib/python3.10/dist-packages (from mkl->numpy>=1.26.4->wfdb) (2024.2.0)\nRequirement already satisfied: tbb==2022.* in /usr/local/lib/python3.10/dist-packages (from mkl->numpy>=1.26.4->wfdb) (2022.0.0)\nRequirement already satisfied: tcmlib==1.* in /usr/local/lib/python3.10/dist-packages (from tbb==2022.*->mkl->numpy>=1.26.4->wfdb) (1.2.0)\nRequirement already satisfied: intel-cmplr-lib-rt in /usr/local/lib/python3.10/dist-packages (from mkl_umath->numpy>=1.26.4->wfdb) (2024.2.0)\nRequirement already satisfied: intel-cmplr-lib-ur==2024.2.0 in /usr/local/lib/python3.10/dist-packages (from intel-openmp>=2024->mkl->numpy>=1.26.4->wfdb) (2024.2.0)\nDownloading wfdb-4.2.0-py3-none-any.whl (162 kB)\n\u001b[2K   \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m162.3/162.3 kB\u001b[0m \u001b[31m2.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n\u001b[?25hInstalling collected packages: wfdb\nSuccessfully installed wfdb-4.2.0\n","output_type":"stream"}],"execution_count":3},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport sys, os\nimport scipy.io\nimport scipy.signal as signal\nimport pickle as dill\nfrom tqdm import tqdm\nfrom time import localtime, strftime\nimport random\n\nfrom shutil import copyfile\n\nfrom sklearn.metrics import log_loss\nfrom sklearn.metrics import roc_auc_score, average_precision_score, f1_score, confusion_matrix\nfrom sklearn.model_selection import train_test_split\n\n\nfrom __future__ import print_function\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader, TensorDataset\nfrom torch.nn.utils.rnn import pack_padded_sequence\n\nfrom tensorflow.keras.preprocessing.sequence import pad_sequences  # Для выравнивания длин сигналов\nimport wfdb\nimport dill\nfrom glob import glob\nimport csv\n\nfrom collections import OrderedDict, Counter\n\nimport scipy.io\nfrom scipy.signal import butter, lfilter, periodogram","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:13:02.112491Z","iopub.execute_input":"2025-04-01T17:13:02.112858Z","iopub.status.idle":"2025-04-01T17:13:02.154416Z","shell.execute_reply.started":"2025-04-01T17:13:02.112828Z","shell.execute_reply":"2025-04-01T17:13:02.153770Z"}},"outputs":[],"execution_count":4},{"cell_type":"code","source":"df = pd.read_csv(\"/kaggle/input/dataset-mina/CPSC/labels.csv\")\ndf.head(20)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:13:04.812048Z","iopub.execute_input":"2025-04-01T17:13:04.812326Z","iopub.status.idle":"2025-04-01T17:13:04.869490Z","shell.execute_reply.started":"2025-04-01T17:13:04.812305Z","shell.execute_reply":"2025-04-01T17:13:04.868811Z"}},"outputs":[{"execution_count":5,"output_type":"execute_result","data":{"text/plain":"   patient_id  SNR  AF  IAVB  LBBB  RBBB  PAC  PVC  STD  STE  fold\n0       A0001    0   0     0     0     1    0    0    0    0     5\n1       A0002    1   0     0     0     0    0    0    0    0     3\n2       A0003    0   1     0     0     0    0    0    0    0     1\n3       A0004    0   1     0     0     0    0    0    0    0     7\n4       A0005    0   0     0     0     0    0    1    0    0     1\n5       A0006    0   0     0     0     1    0    0    0    0    10\n6       A0007    0   1     0     0     0    0    0    0    0     3\n7       A0008    0   0     0     0     0    0    0    1    0     6\n8       A0009    0   1     0     0     0    0    0    0    0     2\n9       A0010    0   0     0     0     1    0    0    0    0    10\n10      A0011    0   0     0     1     0    0    0    0    0    10\n11      A0012    0   0     0     0     0    0    1    0    0     2\n12      A0013    0   0     0     0     0    0    0    1    0    10\n13      A0014    0   0     0     0     0    0    0    1    0     4\n14      A0015    0   0     0     0     1    0    0    0    0    10\n15      A0016    1   0     0     0     0    0    0    0    0     3\n16      A0017    0   1     0     0     0    0    0    0    0     7\n17      A0018    0   0     0     1     0    0    0    0    0     1\n18      A0019    0   1     0     0     0    0    0    0    0    10\n19      A0020    1   0     0     0     0    0    0    0    0     8","text/html":"<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>patient_id</th>\n      <th>SNR</th>\n      <th>AF</th>\n      <th>IAVB</th>\n      <th>LBBB</th>\n      <th>RBBB</th>\n      <th>PAC</th>\n      <th>PVC</th>\n      <th>STD</th>\n      <th>STE</th>\n      <th>fold</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>A0001</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>5</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>A0002</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>A0003</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>A0004</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>A0005</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>A0006</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>10</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>A0007</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>A0008</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>A0009</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>A0010</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>10</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>A0011</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>10</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>A0012</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>2</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>A0013</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>10</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>A0014</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>A0015</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>10</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>A0016</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>16</th>\n      <td>A0017</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>17</th>\n      <td>A0018</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>18</th>\n      <td>A0019</td>\n      <td>0</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>10</td>\n    </tr>\n    <tr>\n      <th>19</th>\n      <td>A0020</td>\n      <td>1</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>0</td>\n      <td>8</td>\n    </tr>\n  </tbody>\n</table>\n</div>"},"metadata":{}}],"execution_count":5},{"cell_type":"code","source":"def preprocess_physionet(data_path, output_path='/kaggle/working/', max_length=9000):\n    \"\"\"\n    Обрабатывает PhysioNet ECG Dataset и сохраняет в .pkl\n    :param data_path: путь к данным\n    :param max_length: длина для padding/truncating сигналов\n    \"\"\"\n\n    # Читаем метки из REFERENCE-v3.csv\n    label_df = pd.read_csv(os.path.join(data_path, 'labels.csv'))\n    \n    # Удаляем 'patient_id', оставляем бинарные метки\n    labels = label_df.drop(columns=['patient_id']).values\n    print(f\"Загружено {labels.shape[0]} меток, {labels.shape[1]} классов.\")\n\n    # Читаем список файлов\n    labels = label_df.iloc[:, 1].values\n    filenames = label_df.iloc[:, 0].values\n    print(f\"Файлы: {filenames[:5]}\")  # Вывод первых 5 файлов\n\n    all_data = []\n    for filename in tqdm(filenames, desc=\"Чтение .mat файлов\"):\n        mat = scipy.io.loadmat(os.path.join(data_path, f'{filename}.mat'))\n        mat = np.array(mat['val'])[0]  # Берем только первый канал\n        all_data.append(mat)\n\n    # Приведение всех последовательностей к одинаковой длине\n    all_data = pad_sequences(all_data, maxlen=max_length, padding='post', truncating='post')\n\n    # Сохраняем данные и метки\n    res = {'data': all_data, 'label': labels}\n    with open(os.path.join(output_path, 'challenge2018.pkl'), 'wb') as fout:\n        dill.dump(res, fout)\n\n    print(f\"Файл сохранен: {os.path.join(output_path, 'challenge2018.pkl')}\")\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:16:30.518963Z","iopub.execute_input":"2025-04-01T17:16:30.519305Z","iopub.status.idle":"2025-04-01T17:16:30.525809Z","shell.execute_reply.started":"2025-04-01T17:16:30.519282Z","shell.execute_reply":"2025-04-01T17:16:30.524934Z"}},"outputs":[],"execution_count":14},{"cell_type":"code","source":"'''def preprocess_physionet(data_path, output_path='/kaggle/working/'):\n    \"\"\"\n    Перед обработкой данных скачайте их с https://physionet.org/content/challenge-2017/1.0.0/ \n    и поместите в data_path.\n    \"\"\"\n\n    label_df = pd.read_csv(os.path.join(data_path, 'labels.csv'))\n    \n    # Удаляем столбец 'patient_id' и сохраняем метки в виде массива\n    label = label_df.drop(columns=['patient_id']).values\n    print(f\"Метки загружены: {label.shape}\")\n\n    # Читаем список файлов\n    labels = label_df.iloc[:, 1].values  # Categories: N, A, O, P\n    filenames = label_df.iloc[:, 0].values\n    print(f\"Файлы: {filenames[:5]}\")  # Вывод первых 5 файлов\n\n    all_data = []\n    for filename in tqdm(filenames, desc=\"Чтение .mat файлов\"):\n        mat = scipy.io.loadmat(os.path.join(data_path, f'{filename}.mat'))\n        mat = np.array(mat['val'])[0]\n        all_data.append(mat)\n\n    all_data = np.array(all_data)\n\n    # Сохраняем данные и метки\n    res = {'data': all_data, 'label': label}\n    with open(os.path.join(output_path, 'challenge2018.pkl'), 'wb') as fout:\n        dill.dump(res, fout)\n\n    print(f\"Файл сохранен: {os.path.join(output_path, 'challenge2018.pkl')}\")'''","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"code","source":"def filter_channel(x):\n    \n    signal_freq = 300\n    \n    ### candidate channels for ECG\n    P_wave = (0.67,5)\n    QRS_complex = (10,50)\n    T_wave = (1,7)\n    muscle = (5,50)\n    resp = (0.12,0.5)\n    ECG_preprocessed = (0.5, 50)\n    wander = (0.001, 0.5)\n    noise = 50\n    \n    ### use low (wander), middle (ECG_preprocessed) and high (noise) for example\n    bandpass_list = [wander, ECG_preprocessed]\n    highpass_list = [noise]\n    \n    nyquist_freq = 0.5 * signal_freq\n    filter_order = 1\n    ### out including original x\n    out_list = [x]\n    \n    for bandpass in bandpass_list:\n        low = bandpass[0] / nyquist_freq\n        high = bandpass[1] / nyquist_freq\n        b, a = butter(filter_order, [low, high], btype=\"band\")\n        y = lfilter(b, a, x)\n        out_list.append(y)\n        \n    for highpass in highpass_list:\n        high = highpass / nyquist_freq\n        b, a = butter(filter_order, high, btype=\"high\")\n        y = lfilter(b, a, x)\n        out_list.append(y)\n        \n    out = np.array(out_list)\n    \n    return out\n\ndef slide_and_cut(X, Y, window_size, stride, output_pid=False):\n    out_X = []\n    out_Y = []\n    out_pid = []\n    n_sample = X.shape[0]\n    mode = 0\n    for i in range(n_sample):\n        tmp_ts = X[i]\n        tmp_Y = Y[i]\n        if tmp_Y == 0:\n            i_stride = stride\n        elif tmp_Y == 1:\n            i_stride = stride//10\n        for j in range(0, len(tmp_ts)-window_size, i_stride):\n            out_X.append(tmp_ts[j:j+window_size])\n            out_Y.append(tmp_Y)\n            out_pid.append(i)\n    if output_pid:\n        return np.array(out_X), np.array(out_Y), np.array(out_pid)\n    else:\n        return np.array(out_X), np.array(out_Y)\n\ndef compute_beat(X):\n    out = np.zeros((X.shape[0], X.shape[1], X.shape[2]))\n    for i in tqdm(range(out.shape[0]), desc=\"compute_beat\"):\n        for j in range(out.shape[1]):\n            out[i, j] = np.concatenate([[0], np.abs(np.diff(X[i,j,:]))])\n    return out\n\ndef compute_rhythm(X, n_split):\n    cnt_split = int(X.shape[2]/n_split)\n    out = np.zeros((X.shape[0], X.shape[1], cnt_split))\n    for i in tqdm(range(out.shape[0]), desc=\"compute_rhythm\"):\n        for j in range(out.shape[1]):\n            tmp_ts = X[i,j,:]\n            tmp_ts_cut = np.split(tmp_ts, X.shape[2]/n_split)\n            for k in range(cnt_split):\n                out[i, j, k] = np.std(tmp_ts_cut[k])\n    return out\n\ndef compute_freq(X):\n    out = np.zeros((X.shape[0], X.shape[1], 1))\n    fs = 300\n    for i in tqdm(range(out.shape[0]), desc=\"compute_freq\"):\n        for j in range(out.shape[1]):\n            _, Pxx_den = periodogram(X[i,j,:], fs)\n            out[i, j, 0] = np.sum(Pxx_den)\n    return out\n\ndef make_data_physionet(data_path, n_split=50, window_size=3000, stride=500, output_path='/kaggle/working/'):\n\n    # read pkl\n    with open(os.path.join(output_path, 'challenge2018.pkl'), 'rb') as fin:\n        res = dill.load(fin)\n    ## scale data\n    all_data = res['data']\n    for i in range(len(all_data)):\n        tmp_data = all_data[i]\n        tmp_std = np.std(tmp_data)\n        tmp_mean = np.mean(tmp_data)\n        all_data[i] = (tmp_data - tmp_mean) / tmp_std # normalize\n    all_data = res['data']\n    all_data = np.array(all_data)\n    ## encode label\n    all_label = []\n    for i in res['label']:\n        if i == 'A':\n            all_label.append(1)\n        else:\n            all_label.append(0)\n    all_label = np.array(all_label)\n\n    # split train test\n    n_sample = len(all_label)\n    split_idx_1 = int(0.75 * n_sample)\n    split_idx_2 = int(0.85 * n_sample)\n    \n    shuffle_idx = np.random.permutation(n_sample)\n    all_data = all_data[shuffle_idx]\n    all_label = all_label[shuffle_idx]\n    \n    X_train = all_data[:split_idx_1]\n    X_val = all_data[split_idx_1:split_idx_2]\n    X_test = all_data[split_idx_2:]\n    Y_train = all_label[:split_idx_1]\n    Y_val = all_label[split_idx_1:split_idx_2]\n    Y_test = all_label[split_idx_2:]\n    \n    # slide and cut\n    print(Counter(Y_train), Counter(Y_val), Counter(Y_test))\n    X_train, Y_train = slide_and_cut(X_train, Y_train, window_size=window_size, stride=stride)\n    X_val, Y_val = slide_and_cut(X_val, Y_val, window_size=window_size, stride=stride)\n    X_test, Y_test, pid_test = slide_and_cut(X_test, Y_test, window_size=window_size, stride=stride, output_pid=True)\n    print('after: ')\n    print(Counter(Y_train), Counter(Y_val), Counter(Y_test))\n    \n    # shuffle train\n    shuffle_pid = np.random.permutation(Y_train.shape[0])\n    X_train = X_train[shuffle_pid]\n    Y_train = Y_train[shuffle_pid]\n\n    # multi-level\n    X_train_ml = []\n    X_val_ml = []\n    X_test_ml = []\n    for i in tqdm(X_train, desc=\"X_train_ml\"):\n        tmp = filter_channel(i)\n        X_train_ml.append(tmp)\n    X_train_ml = np.array(X_train_ml)\n    for i in tqdm(X_val, desc=\"X_val_ml\"):\n        tmp = filter_channel(i)\n        X_val_ml.append(tmp)\n    X_val_ml = np.array(X_val_ml)\n    for i in tqdm(X_test, desc=\"X_test_ml\"):\n        tmp = filter_channel(i)\n        X_test_ml.append(tmp)\n    X_test_ml = np.array(X_test_ml)\n    print(X_train_ml.shape, X_val_ml.shape, X_test_ml.shape)\n\n    # save\n    res = {'Y_train': Y_train, 'Y_val': Y_val, 'Y_test': Y_test, 'pid_test': pid_test}\n    with open(os.path.join(output_path, 'mina_info.pkl'), 'wb') as fout:\n        dill.dump(res, fout)\n        \n    fout = open(os.path.join(output_path, 'mina_X_train.bin'), 'wb')\n    np.save(fout, X_train_ml)\n    fout.close()\n\n    fout = open(os.path.join(output_path, 'mina_X_val.bin'), 'wb')\n    np.save(fout, X_val_ml)\n    fout.close()\n\n    fout = open(os.path.join(output_path, 'mina_X_test.bin'), 'wb')\n    np.save(fout, X_test_ml)\n    fout.close()\n\ndef make_knowledge_physionet(data_path, n_split=50, output_path='/kaggle/working/'):\n\n    # read\n    fin = open(os.path.join(output_path, 'mina_X_train.bin'), 'rb')\n    X_train = np.load(fin)\n    fin.close()\n    fin = open(os.path.join(output_path, 'mina_X_val.bin'), 'rb')\n    X_val = np.load(fin)\n    fin.close()\n    fin = open(os.path.join(output_path, 'mina_X_test.bin'), 'rb')\n    X_test = np.load(fin)\n    fin.close()\n\n    # compute knowledge\n    K_train_beat = compute_beat(X_train)\n    K_train_rhythm = compute_rhythm(X_train, n_split)\n    K_train_freq = compute_freq(X_train)\n\n    K_val_beat = compute_beat(X_val)\n    K_val_rhythm = compute_rhythm(X_val, n_split)\n    K_val_freq = compute_freq(X_val)\n\n    K_test_beat = compute_beat(X_test)\n    K_test_rhythm = compute_rhythm(X_test, n_split)\n    K_test_freq = compute_freq(X_test)\n\n    # save\n    fout = open(os.path.join(output_path, 'mina_K_train_beat.bin'), 'wb')\n    np.save(fout, K_train_beat)\n    fout.close()\n    fout = open(os.path.join(output_path, 'mina_K_val_beat.bin'), 'wb')\n    np.save(fout, K_val_beat)\n    fout.close()\n    fout = open(os.path.join(output_path, 'mina_K_test_beat.bin'), 'wb')\n    np.save(fout, K_test_beat)\n    fout.close()\n\n    res = {'K_train_rhythm': K_train_rhythm, 'K_train_freq': K_train_freq, \n    'K_val_rhythm': K_val_rhythm, 'K_val_freq': K_val_freq, \n    'K_test_rhythm': K_test_rhythm, 'K_test_freq': K_test_freq}\n    with open(os.path.join(output_path, 'mina_knowledge.pkl'), 'wb') as fout:\n        dill.dump(res, fout)\n\n\"\"\"def evaluate(gt, pred):\n    '''\n    gt is (0, C-1)\n    pred is list of probability\n    '''\n\n    pred_label = []\n    for i in pred:\n        pred_label.append(np.argmax(i))\n    pred_label = np.array(pred_label)\n\n    res = OrderedDict({})\n    \n    res['auroc'] = roc_auc_score(gt, pred[:,1])\n    res['auprc'] = average_precision_score(gt, pred[:,1])\n    res['f1'] = f1_score(gt, pred_label)\n    \n    res['\\nmat'] = confusion_matrix(gt, pred_label)\n    \n    for k, v in res.items():\n        print(k, ':', v, '|', end='')\n    print()\n    \n    return list(res.values())\"\"\"","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:26:33.560535Z","iopub.execute_input":"2025-04-01T17:26:33.560914Z","iopub.status.idle":"2025-04-01T17:26:33.589877Z","shell.execute_reply.started":"2025-04-01T17:26:33.560890Z","shell.execute_reply":"2025-04-01T17:26:33.589008Z"}},"outputs":[{"execution_count":19,"output_type":"execute_result","data":{"text/plain":"\"def evaluate(gt, pred):\\n    '''\\n    gt is (0, C-1)\\n    pred is list of probability\\n    '''\\n\\n    pred_label = []\\n    for i in pred:\\n        pred_label.append(np.argmax(i))\\n    pred_label = np.array(pred_label)\\n\\n    res = OrderedDict({})\\n    \\n    res['auroc'] = roc_auc_score(gt, pred[:,1])\\n    res['auprc'] = average_precision_score(gt, pred[:,1])\\n    res['f1'] = f1_score(gt, pred_label)\\n    \\n    res['\\nmat'] = confusion_matrix(gt, pred_label)\\n    \\n    for k, v in res.items():\\n        print(k, ':', v, '|', end='')\\n    print()\\n    \\n    return list(res.values())\""},"metadata":{}}],"execution_count":19},{"cell_type":"code","source":"def evaluate(gt, pred):\n    res = OrderedDict({})\n\n    # Проверяем, есть ли оба класса (0 и 1) в `gt`\n    unique_classes = np.unique(gt)\n    if len(unique_classes) < 2:\n        print(f\"Warning: Only one class {unique_classes} in y_true. ROC AUC cannot be computed.\")\n        res['auroc'] = None\n        res['auprc'] = None\n    else:\n        res['auroc'] = roc_auc_score(gt, pred[:, 1])\n        res['auprc'] = average_precision_score(gt, pred[:, 1])\n\n    # Вычисляем F1-метрику независимо от наличия одного класса\n    pred_label = (pred[:, 1] > 0.5).astype(int)  # Бинаризация предсказаний\n    res['f1'] = f1_score(gt, pred_label) if len(unique_classes) > 1 else None\n\n    return res","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:19:15.549217Z","iopub.execute_input":"2025-04-01T17:19:15.549492Z","iopub.status.idle":"2025-04-01T17:19:15.554593Z","shell.execute_reply.started":"2025-04-01T17:19:15.549472Z","shell.execute_reply":"2025-04-01T17:19:15.553748Z"}},"outputs":[],"execution_count":16},{"cell_type":"code","source":"class Net(nn.Module):\n    def __init__(self, n_channel, n_dim, n_split):\n        super(Net, self).__init__()\n        \n        self.n_channel = n_channel\n        self.n_dim = n_dim\n        self.n_split = n_split\n        self.n_class = 2\n        \n        self.base_net_0 = BaseNet(self.n_dim, self.n_split)\n        self.base_net_1 = BaseNet(self.n_dim, self.n_split)\n        self.base_net_2 = BaseNet(self.n_dim, self.n_split)\n        self.base_net_3 = BaseNet(self.n_dim, self.n_split)\n            \n        ### attention\n        self.out_size = 8\n        self.att_channel_dim = 2\n        self.W_att_channel = nn.Parameter(torch.randn(self.out_size+1, self.att_channel_dim))\n        self.v_att_channel = nn.Parameter(torch.randn(self.att_channel_dim, 1))\n        \n        ### fc\n        self.fc = nn.Linear(self.out_size, self.n_class)\n        \n    def forward(self, x_0, x_1, x_2, x_3, \n                k_beat_0, k_beat_1, k_beat_2, k_beat_3, \n                k_rhythm_0, k_rhythm_1, k_rhythm_2, k_rhythm_3, \n                k_freq):\n\n        x_0, alpha_0, beta_0 = self.base_net_0(x_0, k_beat_0, k_rhythm_0)\n        x_1, alpha_1, beta_1 = self.base_net_1(x_1, k_beat_1, k_rhythm_1)\n        x_2, alpha_2, beta_2 = self.base_net_2(x_2, k_beat_2, k_rhythm_2)\n        x_3, alpha_3, beta_3 = self.base_net_3(x_3, k_beat_3, k_rhythm_3)\n        \n        x = torch.stack([x_0, x_1, x_2, x_3], 1)\n\n        # ############################################\n        # ### attention on channel\n        # ############################################\n        k_freq = k_freq.permute(1, 0, 2)\n\n        tmp_x = torch.cat((x, k_freq), dim=-1)\n        e = torch.matmul(tmp_x, self.W_att_channel)\n        e = torch.matmul(torch.tanh(e), self.v_att_channel)\n        n1 = torch.exp(e)\n        n2 = torch.sum(torch.exp(e), 1, keepdim=True)\n        gama = torch.div(n1, n2)\n        x = torch.sum(torch.mul(gama, x), 1)\n        \n        ############################################\n        ### fc\n        ############################################\n        x = F.softmax(self.fc(x), 1)\n        \n        ############################################\n        ### return \n        ############################################\n        \n        att_dic = {\"alpha_0\":alpha_0, \"beta_0\":beta_0, \n                  \"alpha_1\":alpha_1, \"beta_1\":beta_1, \n                  \"alpha_2\":alpha_2, \"beta_2\":beta_2, \n                  \"alpha_3\":alpha_3, \"beta_3\":beta_3, \n                  \"gama\":gama}\n        \n        return x, att_dic","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:13:19.712668Z","iopub.execute_input":"2025-04-01T17:13:19.712987Z","iopub.status.idle":"2025-04-01T17:13:19.723065Z","shell.execute_reply.started":"2025-04-01T17:13:19.712966Z","shell.execute_reply":"2025-04-01T17:13:19.722174Z"}},"outputs":[],"execution_count":8},{"cell_type":"code","source":"class BaseNet(nn.Module):\n    def __init__(self, n_dim, n_split):\n        super(BaseNet, self).__init__()\n        \n        self.n_dim = n_dim\n        self.n_split = n_split\n        self.n_seg = int(n_dim/n_split)\n        \n        ### Input: (batch size, number of channels, length of signal sequence)\n        self.conv_out_channels = 64\n        self.conv_kernel_size = 32\n        self.conv_stride = 2\n        self.conv = nn.Conv1d(in_channels=1, \n                              out_channels=self.conv_out_channels, \n                              kernel_size=self.conv_kernel_size, \n                              stride=self.conv_stride)\n        self.conv_k = nn.Conv1d(in_channels=1, \n                                out_channels=1, \n                                kernel_size=self.conv_kernel_size, \n                                stride=self.conv_stride)\n        self.att_cnn_dim = 8\n        self.W_att_cnn = nn.Parameter(torch.randn(self.conv_out_channels+1, self.att_cnn_dim))\n        self.v_att_cnn = nn.Parameter(torch.randn(self.att_cnn_dim, 1))\n        \n        ### Input: (batch size, length of signal sequence, input_size)\n        self.rnn_hidden_size = 32\n        self.lstm = nn.LSTM(input_size=(self.conv_out_channels), \n                            hidden_size=self.rnn_hidden_size, \n                            num_layers=1, batch_first=True, bidirectional=True)\n        self.att_rnn_dim = 8\n        self.W_att_rnn = nn.Parameter(torch.randn(2*self.rnn_hidden_size+1, self.att_rnn_dim))\n        self.v_att_rnn = nn.Parameter(torch.randn(self.att_rnn_dim, 1))\n        \n        ### fc\n        self.do = nn.Dropout(p=0.5)\n        self.out_size = 8\n        self.fc = nn.Linear(2*self.rnn_hidden_size, self.out_size)\n    \n    def forward(self, x, k_beat, k_rhythm):\n        \n        self.batch_size = x.size()[0]\n\n        ############################################\n        ### reshape\n        ############################################\n        # print('orignial x:', x.size())\n        x = x.view(-1, self.n_split)\n        x = x.unsqueeze(1)\n        \n        k_beat = k_beat.view(-1, self.n_split)\n        k_beat = k_beat.unsqueeze(1)\n        \n        ############################################\n        ### conv\n        ############################################\n        x = F.relu(self.conv(x))\n        \n        k_beat = F.relu(self.conv_k(k_beat))\n        \n        ############################################\n        ### attention conv\n        ############################################\n        x = x.permute(0, 2, 1)\n        k_beat = k_beat.permute(0, 2, 1)\n        tmp_x = torch.cat((x, k_beat), dim=-1)\n        e = torch.matmul(tmp_x, self.W_att_cnn)\n        e = torch.matmul(torch.tanh(e), self.v_att_cnn)\n        n1 = torch.exp(e)\n        n2 = torch.sum(torch.exp(e), 1, keepdim=True)\n        alpha = torch.div(n1, n2)\n        x = torch.sum(torch.mul(alpha, x), 1)\n        \n        ############################################\n        ### reshape for rnn\n        ############################################\n        x = x.view(self.batch_size, self.n_seg, -1)\n    \n        ############################################\n        ### rnn        \n        ############################################\n        \n        k_rhythm = k_rhythm.unsqueeze(-1)\n        o, (ht, ct) = self.lstm(x)\n        tmp_o = torch.cat((o, k_rhythm), dim=-1)\n        e = torch.matmul(tmp_o, self.W_att_rnn)\n        e = torch.matmul(torch.tanh(e), self.v_att_rnn)\n        n1 = torch.exp(e)\n        n2 = torch.sum(torch.exp(e), 1, keepdim=True)\n        beta = torch.div(n1, n2)\n        x = torch.sum(torch.mul(beta, o), 1)\n        \n        ############################################\n        ### fc\n        ############################################\n        x = F.relu(self.fc(x))\n        x = self.do(x)\n        \n        return x, alpha, beta        ","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:13:24.086409Z","iopub.execute_input":"2025-04-01T17:13:24.086735Z","iopub.status.idle":"2025-04-01T17:13:24.097918Z","shell.execute_reply.started":"2025-04-01T17:13:24.086708Z","shell.execute_reply":"2025-04-01T17:13:24.097043Z"}},"outputs":[],"execution_count":9},{"cell_type":"code","source":"def train(model, optimizer, loss_func, epoch, batch_size, \n          X_train, Y_train, K_train_beat, K_train_rhythm, K_train_freq, \n          log_file):\n    \"\"\"\n    X_train: (n_channel, n_sample, n_dim)\n    Y_train: (n_sample,)\n    \n    K_train_beat: (n_channel, n_sample, n_dim)\n    K_train_rhythm: (n_channel, n_sample, n_dim/n_split)\n    K_train_freq: (n_channel, n_sample)\n    \"\"\"\n    model.train()\n    \n    n_train = len(Y_train)\n    \n    pred_all = []\n    batch_start_idx = 0\n    batch_end_idx = 0\n    loss_all = []\n    for _ in tqdm(range(n_train//batch_size+1), desc=\"train\"):\n    # while batch_end_idx < n_train:\n        # print('.', end=\"\")\n        batch_end_idx = batch_end_idx + batch_size\n        if batch_end_idx >= n_train:\n            batch_end_idx = n_train\n            \n        ### input data\n        batch_input_0 = Variable(torch.FloatTensor(X_train[0, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_input_1 = Variable(torch.FloatTensor(X_train[1, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_input_2 = Variable(torch.FloatTensor(X_train[2, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_input_3 = Variable(torch.FloatTensor(X_train[3, batch_start_idx: batch_end_idx, :])).cuda()\n        \n        ### input K_beat\n        batch_K_beat_0 = Variable(torch.FloatTensor(K_train_beat[0, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_beat_1 = Variable(torch.FloatTensor(K_train_beat[1, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_beat_2 = Variable(torch.FloatTensor(K_train_beat[2, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_beat_3 = Variable(torch.FloatTensor(K_train_beat[3, batch_start_idx: batch_end_idx, :])).cuda()\n\n        ### input K_rhythm\n        batch_K_rhythm_0 = Variable(torch.FloatTensor(K_train_rhythm[0, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_rhythm_1 = Variable(torch.FloatTensor(K_train_rhythm[1, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_rhythm_2 = Variable(torch.FloatTensor(K_train_rhythm[2, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_rhythm_3 = Variable(torch.FloatTensor(K_train_rhythm[3, batch_start_idx: batch_end_idx, :])).cuda()        \n        \n        ### input K_freq\n        batch_K_freq = Variable(torch.FloatTensor(K_train_freq[:, batch_start_idx: batch_end_idx, :])).cuda()  \n        \n        ### gt\n        batch_gt = Variable(torch.LongTensor(Y_train[batch_start_idx: batch_end_idx])).cuda()\n        \n        pred, _ = model(batch_input_0, batch_input_1, batch_input_2, batch_input_3, \n                        batch_K_beat_0, batch_K_beat_1, batch_K_beat_2, batch_K_beat_3, \n                        batch_K_rhythm_0, batch_K_rhythm_1, batch_K_rhythm_2, batch_K_rhythm_3, \n                        batch_K_freq)\n        \n        pred_all.append(pred.cpu().data.numpy())\n        # print(pred, batch_gt)\n\n        loss = loss_func(pred, batch_gt)\n        loss_all.append(loss.cpu().data.numpy())\n        optimizer.zero_grad()\n        loss.backward()\n        optimizer.step()\n\n        batch_start_idx = batch_start_idx + batch_size\n\n    loss_res = np.mean(loss_all)\n    print('epoch {0} '.format(epoch))\n    print('loss ', np.mean(loss_all))\n    print('train | ', end='')\n    pred_all = np.concatenate(pred_all, axis=0)\n    # print(Y_train.shape, pred_all.shape)\n    res = evaluate(Y_train, pred_all)\n    res['loss_res'] = loss_res\n    res['pred_all'] = pred_all\n    # res.append(loss_res)\n    # res.append(pred_all)\n    \n    with open(log_file, 'a') as fout:\n        print('epoch {0} '.format(epoch), 'train | ', res, file=fout)\n        print('loss_all ', np.mean(loss_all), file=fout)\n        \n    return res\n    \n\ndef test(model, batch_size, \n         X_test, Y_test, K_test_beat, K_test_rhythm, K_test_freq, \n         log_file):\n    \n    model.eval()\n    \n    n_test = len(Y_test)\n    \n    pred_all = []\n    att_dic_all = []\n    \n    batch_start_idx = 0\n    batch_end_idx = 0\n    for _ in tqdm(range(n_test//batch_size+1), desc=\"test\"):\n    # while batch_end_idx < n_test:\n        # print('.', end=\"\")\n        batch_end_idx = batch_end_idx + batch_size\n        if batch_end_idx >= n_test:\n            batch_end_idx = n_test\n            \n        ### input data\n        batch_input_0 = Variable(torch.FloatTensor(X_test[0, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_input_1 = Variable(torch.FloatTensor(X_test[1, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_input_2 = Variable(torch.FloatTensor(X_test[2, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_input_3 = Variable(torch.FloatTensor(X_test[3, batch_start_idx: batch_end_idx, :])).cuda()\n        \n        ### input K_beat\n        batch_K_beat_0 = Variable(torch.FloatTensor(K_test_beat[0, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_beat_1 = Variable(torch.FloatTensor(K_test_beat[1, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_beat_2 = Variable(torch.FloatTensor(K_test_beat[2, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_beat_3 = Variable(torch.FloatTensor(K_test_beat[3, batch_start_idx: batch_end_idx, :])).cuda()\n\n        ### input K_rhythm\n        batch_K_rhythm_0 = Variable(torch.FloatTensor(K_test_rhythm[0, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_rhythm_1 = Variable(torch.FloatTensor(K_test_rhythm[1, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_rhythm_2 = Variable(torch.FloatTensor(K_test_rhythm[2, batch_start_idx: batch_end_idx, :])).cuda()\n        batch_K_rhythm_3 = Variable(torch.FloatTensor(K_test_rhythm[3, batch_start_idx: batch_end_idx, :])).cuda()\n        \n        ### input K_freq\n        batch_K_freq = Variable(torch.FloatTensor(K_test_freq[:, batch_start_idx: batch_end_idx, :])).cuda()\n        \n        ### gt\n        batch_gt = Variable(torch.LongTensor(Y_test[batch_start_idx: batch_end_idx])).cuda()\n\n        pred, att_dic = model(batch_input_0, batch_input_1, batch_input_2, batch_input_3, \n                              batch_K_beat_0, batch_K_beat_1, batch_K_beat_2, batch_K_beat_3, \n                              batch_K_rhythm_0, batch_K_rhythm_1, batch_K_rhythm_2, batch_K_rhythm_3, \n                              batch_K_freq)\n            \n        for k, v in att_dic.items():\n            att_dic[k] = v.cpu().data.numpy()\n        att_dic_all.append(att_dic)\n        pred_all.append(pred.cpu().data.numpy())\n\n        batch_start_idx = batch_start_idx + batch_size\n\n    print('test | ', end='')\n    pred_all = np.concatenate(pred_all, axis=0)\n    res = evaluate(Y_test, pred_all)\n    res['pred_all'] = pred_all\n    # res.append(pred_all)\n    \n    with open(log_file, 'a') as fout:\n        print('test | ', res, file=fout)\n\n    return res, att_dic_all\n\ndef run(data_path, output_path='/kaggle/working/'):\n\n    n_epoch = 200\n    lr = 0.003\n    n_split = 50\n\n    ##################################################################\n    ### par\n    ##################################################################\n    run_id = 'mina_{0}'.format(strftime(\"%Y-%m-%d-%H-%M-%S\", localtime()))\n    directory = 'res/{0}'.format(run_id)\n    try:\n        os.stat('res/')\n    except:\n        os.mkdir('res/')    \n    try:\n        os.stat(directory)\n    except:\n        os.mkdir(directory)\n    \n    log_file = '{0}/log.txt'.format(directory)\n    model_file = '/kaggle/input/dataset-mina/CPSC/mina.py'\n    destination_file = os.path.join(directory, os.path.basename(model_file))  # Правильный путь\n\n    copyfile(model_file, destination_file)  # Копируем корректно\n    #copyfile(model_file, '{0}/{1}'.format(directory, model_file))\n\n    n_dim = 3000\n    batch_size = 128\n\n    with open(log_file, 'a') as fout:\n        print(run_id, file=fout)\n\n    ##################################################################\n    ### read data\n    ##################################################################\n    with open(os.path.join(output_path, 'mina_info.pkl'), 'rb') as fin:\n        res = dill.load(fin)    \n    Y_train = res['Y_train']\n    Y_val = res['Y_val']\n    Y_test = res['Y_test']\n    print(Counter(Y_train), Counter(Y_val), Counter(Y_test))\n\n    fin = open(os.path.join(output_path, 'mina_X_train.bin'), 'rb')\n    X_train = np.load(fin)\n    fin.close()\n    fin = open(os.path.join(output_path, 'mina_X_val.bin'), 'rb')\n    X_val = np.load(fin)\n    fin.close()\n    fin = open(os.path.join(output_path, 'mina_X_test.bin'), 'rb')\n    X_test = np.load(fin)\n    fin.close()\n    X_train = np.swapaxes(X_train, 0, 1)\n    X_val = np.swapaxes(X_val, 0, 1)\n    X_test = np.swapaxes(X_test, 0, 1)\n    print(X_train.shape, X_val.shape, X_test.shape)\n\n    fin = open(os.path.join(output_path, 'mina_K_train_beat.bin'), 'rb')\n    K_train_beat = np.load(fin)\n    fin.close()\n    fin = open(os.path.join(output_path, 'mina_K_val_beat.bin'), 'rb')\n    K_val_beat = np.load(fin)\n    fin.close()\n    fin = open(os.path.join(output_path, 'mina_K_test_beat.bin'), 'rb')\n    K_test_beat = np.load(fin)\n    fin.close()\n    with open(os.path.join(output_path, 'mina_knowledge.pkl'), 'rb') as fin:\n        res = dill.load(fin)    \n    K_train_rhythm = res['K_train_rhythm']\n    K_train_freq = res['K_train_freq']\n    K_val_rhythm = res['K_val_rhythm']\n    K_val_freq = res['K_val_freq']\n    K_test_rhythm = res['K_test_rhythm']\n    K_test_freq = res['K_test_freq']\n    K_train_beat = np.swapaxes(K_train_beat, 0, 1)\n    K_train_rhythm = np.swapaxes(K_train_rhythm, 0, 1)\n    K_train_freq = np.swapaxes(K_train_freq, 0, 1)\n    K_val_beat = np.swapaxes(K_val_beat, 0, 1)\n    K_val_rhythm = np.swapaxes(K_val_rhythm, 0, 1)\n    K_val_freq = np.swapaxes(K_val_freq, 0, 1)\n    K_test_beat = np.swapaxes(K_test_beat, 0, 1)\n    K_test_rhythm = np.swapaxes(K_test_rhythm, 0, 1)\n    K_test_freq = np.swapaxes(K_test_freq, 0, 1)\n    print(K_train_beat.shape, K_train_rhythm.shape, K_train_freq.shape)\n    print(K_val_beat.shape, K_val_rhythm.shape, K_val_freq.shape)\n    print(K_test_beat.shape, K_test_rhythm.shape, K_test_freq.shape)\n\n    print('load data done!')\n    \n    ##################################################################\n    ### train\n    ##################################################################\n\n    n_channel = X_train.shape[0]\n    print('n_channel:', n_channel)\n\n    torch.cuda.manual_seed(0)\n\n    model = Net(n_channel, n_dim, n_split)\n    model.cuda()\n\n    optimizer = optim.Adam(model.parameters(), lr=lr)\n    # weight = Variable(torch.FloatTensor([n_train/cnter[0], n_train/cnter[1]])).cuda()\n    loss_func = torch.nn.CrossEntropyLoss()\n\n    train_res_list = []\n    val_res_list = []\n    test_res_list = []\n    val_att_list = []\n    test_att_list = []\n    for epoch in range(n_epoch):\n        tmp_train = train(model, optimizer, loss_func, epoch, batch_size, \n                          X_train, Y_train, K_train_beat, K_train_rhythm, K_train_freq, \n                          log_file)\n        tmp_val, tmp_att_val = test(model, batch_size, \n                                    X_val, Y_val, K_val_beat, K_val_rhythm, K_val_freq, \n                                    log_file)\n        tmp_test, tmp_att_test = test(model, batch_size, \n                                      X_test, Y_test, K_test_beat, K_test_rhythm, K_test_freq, \n                                      log_file)\n        \n        train_res_list.append(tmp_train)\n        val_res_list.append(tmp_val)\n        test_res_list.append(tmp_test)\n        # val_att_list.append(tmp_att_val)\n        test_att_list.append(tmp_att_test)\n        torch.save(model, '{0}/model_{1}.pt'.format(directory, epoch))\n    \n    ##################################################################\n    ### save results\n    ##################################################################\n    res_mat = []\n    for i in range(n_epoch):\n        train_res = train_res_list[i]\n        val_res = val_res_list[i]\n        test_res = test_res_list[i]\n        res_mat.append([\n            train_res[0], train_res[1], \n            val_res[0], val_res[1], \n            test_res[0], test_res[1]])\n    res_mat = np.array(res_mat)\n\n    res = {'train_res_list':train_res_list, \n           'val_res_list':val_res_list, \n           'test_res_list':test_res_list}\n    with open('{0}/res.pkl'.format(directory), 'wb') as fout:\n        dill.dump(res, fout)\n    \n    np.savetxt('{0}/res_mat.csv'.format(directory), res_mat, delimiter=',')\n    \n    try:\n        res = {'test_att_list':test_att_list}\n        with open('{0}/res_att.pkl'.format(directory), 'wb') as fout:\n            dill.dump(res, fout)\n    except:\n        print('error in saving attention file')","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:14:11.594890Z","iopub.execute_input":"2025-04-01T17:14:11.595304Z","iopub.status.idle":"2025-04-01T17:14:11.630179Z","shell.execute_reply.started":"2025-04-01T17:14:11.595273Z","shell.execute_reply":"2025-04-01T17:14:11.629420Z"}},"outputs":[],"execution_count":11},{"cell_type":"code","source":"# !rm -rf /kaggle/working/res/*","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T15:36:51.996188Z","iopub.execute_input":"2025-04-01T15:36:51.996573Z","iopub.status.idle":"2025-04-01T15:36:52.139520Z","shell.execute_reply.started":"2025-04-01T15:36:51.996542Z","shell.execute_reply":"2025-04-01T15:36:52.138466Z"}},"outputs":[],"execution_count":1},{"cell_type":"code","source":"# prepare data\ndata_path = '/kaggle/input/dataset-mina/CPSC'\noutput_path = '/kaggle/working/'","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:14:16.753608Z","iopub.execute_input":"2025-04-01T17:14:16.753936Z","iopub.status.idle":"2025-04-01T17:14:16.757696Z","shell.execute_reply.started":"2025-04-01T17:14:16.753913Z","shell.execute_reply":"2025-04-01T17:14:16.756751Z"}},"outputs":[],"execution_count":12},{"cell_type":"code","source":"preprocess_physionet(data_path)\nmake_data_physionet(data_path) \nmake_knowledge_physionet(data_path)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:26:43.629428Z","iopub.execute_input":"2025-04-01T17:26:43.629784Z","iopub.status.idle":"2025-04-01T17:37:28.772041Z","shell.execute_reply.started":"2025-04-01T17:26:43.629754Z","shell.execute_reply":"2025-04-01T17:37:28.771342Z"}},"outputs":[{"name":"stdout","text":"Загружено 6877 меток, 10 классов.\nФайлы: ['A0001' 'A0002' 'A0003' 'A0004' 'A0005']\n","output_type":"stream"},{"name":"stderr","text":"Чтение .mat файлов: 100%|██████████| 6877/6877 [00:08<00:00, 850.75it/s]\n","output_type":"stream"},{"name":"stdout","text":"Файл сохранен: /kaggle/working/challenge2018.pkl\nCounter({0: 5157}) Counter({0: 688}) Counter({0: 1032})\nafter: \nCounter({0: 61884}) Counter({0: 8256}) Counter({0: 12384})\n","output_type":"stream"},{"name":"stderr","text":"X_train_ml: 100%|██████████| 61884/61884 [00:47<00:00, 1309.13it/s]\nX_val_ml: 100%|██████████| 8256/8256 [00:05<00:00, 1511.39it/s]\nX_test_ml: 100%|██████████| 12384/12384 [00:08<00:00, 1503.73it/s]\n","output_type":"stream"},{"name":"stdout","text":"(61884, 4, 3000) (8256, 4, 3000) (12384, 4, 3000)\n","output_type":"stream"},{"name":"stderr","text":"compute_beat: 100%|██████████| 61884/61884 [00:07<00:00, 7747.56it/s]\ncompute_rhythm: 100%|██████████| 61884/61884 [05:16<00:00, 195.53it/s]\ncompute_freq: 100%|██████████| 61884/61884 [00:53<00:00, 1165.17it/s]\ncompute_beat: 100%|██████████| 8256/8256 [00:00<00:00, 15417.60it/s]\ncompute_rhythm: 100%|██████████| 8256/8256 [00:42<00:00, 192.57it/s]\ncompute_freq: 100%|██████████| 8256/8256 [00:07<00:00, 1160.61it/s]\ncompute_beat: 100%|██████████| 12384/12384 [00:00<00:00, 14889.24it/s]\ncompute_rhythm: 100%|██████████| 12384/12384 [01:04<00:00, 190.60it/s]\ncompute_freq: 100%|██████████| 12384/12384 [00:10<00:00, 1165.78it/s]\n","output_type":"stream"}],"execution_count":20},{"cell_type":"code","source":" # run\nfor i_run in range(1):\n    run(data_path)","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2025-04-01T17:39:20.263935Z","iopub.execute_input":"2025-04-01T17:39:20.264291Z","execution_failed":"2025-04-01T18:09:54.065Z"}},"outputs":[{"name":"stdout","text":"Counter({0: 61884}) Counter({0: 8256}) Counter({0: 12384})\n(4, 61884, 3000) (4, 8256, 3000) (4, 12384, 3000)\n(4, 61884, 3000) (4, 61884, 60) (4, 61884, 1)\n(4, 8256, 3000) (4, 8256, 60) (4, 8256, 1)\n(4, 12384, 3000) (4, 12384, 60) (4, 12384, 1)\nload data done!\nn_channel: 4\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 34.61it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 0 \nloss  0.32370442\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 78.32it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.77it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:12<00:00, 37.38it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 1 \nloss  0.31354338\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.69it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 70.34it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 37.12it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 2 \nloss  0.31342363\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.47it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.69it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 37.01it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 3 \nloss  0.31348503\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.95it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.39it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.61it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 4 \nloss  0.31339282\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.16it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.64it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 5 \nloss  0.31338903\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.51it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.73it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.03it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 6 \nloss  0.31336305\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.73it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.28it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.28it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 7 \nloss  0.3133765\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.47it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.98it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.88it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 8 \nloss  0.31335765\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.51it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.14it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.27it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 9 \nloss  0.31335917\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.62it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.74it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.42it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 10 \nloss  0.3133367\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.06it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.04it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.54it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 11 \nloss  0.31331518\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.23it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.48it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.28it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 12 \nloss  0.3133253\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.34it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 78.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.40it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 13 \nloss  0.3133171\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.16it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.53it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.20it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 14 \nloss  0.3133138\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.88it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.00it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.33it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 15 \nloss  0.31330368\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.04it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.88it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.25it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 16 \nloss  0.31329742\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.82it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.58it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.33it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 17 \nloss  0.31328914\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.76it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.43it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.29it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 18 \nloss  0.31328335\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.59it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.77it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.45it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 19 \nloss  0.31328058\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.19it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.78it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.15it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 20 \nloss  0.31327653\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.18it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.76it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.48it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 21 \nloss  0.31327227\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.25it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.22it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.20it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 22 \nloss  0.3132717\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.84it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.08it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.20it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 23 \nloss  0.31326804\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.33it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.09it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.20it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 24 \nloss  0.31326723\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.29it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.31it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.43it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 25 \nloss  0.31326786\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.02it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.11it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.01it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 26 \nloss  0.31326678\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.80it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.14it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.47it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 27 \nloss  0.31326547\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.79it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.63it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.87it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 28 \nloss  0.31326482\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.52it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.31it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.46it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 29 \nloss  0.313264\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 72.54it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 74.69it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.28it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 30 \nloss  0.3132635\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.87it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.53it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.90it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 31 \nloss  0.31326345\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.20it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 73.46it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.76it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 32 \nloss  0.31326333\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.12it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.24it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.08it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 33 \nloss  0.31326282\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.54it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.04it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.99it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 34 \nloss  0.3132623\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.95it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.41it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.73it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 35 \nloss  0.3132625\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.66it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.34it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.77it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 36 \nloss  0.3132623\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 70.27it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.03it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 37 \nloss  0.3132622\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.03it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.77it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.19it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 38 \nloss  0.31326225\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 69.26it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 74.48it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.18it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 39 \nloss  0.3132622\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.05it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.83it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.12it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 40 \nloss  0.31326216\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 65.61it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.21it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.19it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 41 \nloss  0.31326202\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.87it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.24it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 42 \nloss  0.31326202\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.72it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 67.69it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.22it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 43 \nloss  0.31326202\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.97it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.65it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.46it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 44 \nloss  0.31326202\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.70it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 74.58it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.25it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 45 \nloss  0.313262\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.51it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.75it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.49it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 46 \nloss  0.313262\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.38it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.78it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.22it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 47 \nloss  0.31326196\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 75.38it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.46it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.50it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 48 \nloss  0.31326196\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.43it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.19it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 49 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.50it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.93it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.19it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 50 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 76.07it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.94it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.94it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 51 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.73it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.26it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 52 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.82it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.41it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.94it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 53 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.35it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.07it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.43it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 54 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.36it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.02it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.19it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 55 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.38it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.16it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.51it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 56 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 72.78it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 74.71it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.03it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 57 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.06it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.47it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.40it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 58 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 71.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.59it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.01it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 59 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.05it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.55it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.41it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 60 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.33it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.79it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 61 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.19it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.15it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.36it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 62 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.42it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.14it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.09it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 63 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 72.62it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.22it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.53it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 64 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.38it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.87it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.21it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 65 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.27it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 74.05it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.49it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 66 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 70.82it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.95it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.15it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 67 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 70.58it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.21it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.61it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 68 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 72.60it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.26it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.93it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 69 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 74.36it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.72it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.57it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 70 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.41it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 76.06it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.20it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 71 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 72.37it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.61it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.26it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 72 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 72.36it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.55it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.99it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 73 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 71.52it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 77.16it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.37it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 74 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.17it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 74.24it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.21it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 75 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 72.74it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.64it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.29it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 76 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 71.60it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.98it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.16it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 77 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 71.38it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 73.12it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.85it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 78 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 68.54it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 74.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.84it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 79 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 73.55it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.97it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.00it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 80 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 71.15it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 74.81it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.69it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 81 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 70.09it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 73.80it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.14it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 82 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 72.05it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.27it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.15it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 83 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 68.48it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.44it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.72it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 84 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 72.63it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.20it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.96it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 85 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 69.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.18it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 35.93it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 86 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 72.00it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.19it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.03it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 87 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 66.62it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 97/97 [00:01<00:00, 75.04it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"train: 100%|██████████| 484/484 [00:13<00:00, 36.13it/s]\n","output_type":"stream"},{"name":"stdout","text":"epoch 88 \nloss  0.31326193\ntrain | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test: 100%|██████████| 65/65 [00:00<00:00, 65.24it/s]\n","output_type":"stream"},{"name":"stdout","text":"test | Warning: Only one class [0] in y_true. ROC AUC cannot be computed.\n","output_type":"stream"},{"name":"stderr","text":"test:  89%|████████▊ | 86/97 [06:17<10:17, 56.15s/it]","output_type":"stream"}],"execution_count":null}]}